#!/usr/bin/python2.5
# LEAVE THE FOLLOWING TWO LINES
# GAME BAKER
# yaml
# 0
s = """
!!python/object:game.Game
gameobjects:
  Score: &id002 !!python/object:game.GameObject
    baseworkstate: WSScore
    name: Score
    objtype: Gameobject
    requires: []
    sprite: null
  test_object: &id001 !!python/object:game.GameObject
    baseworkstate: WS1
    name: test_object
    objtype: Gameobject
    requires: []
    sprite: puppyspr
gamescreens:
  screen1: !!python/object:game.GameScreen
    color: !!python/tuple [255, 255, 255]
    dimensions: !!python/tuple [850, 600]
    objtype: Gamescreen
    startobjects:
    - *id001
    - *id002
initcode: ''
objtype: Game
sprites:
  puppyspr: !!python/object:game.Sprite
    alphakey: !!python/tuple [0, 255, 0]
    framerate: 1
    imagefiles:
    - bottomright: !!python/tuple [45, 45]
      filename: images/puppy.bmp
      topleft: !!python/tuple [0, 0]
    - bottomright: !!python/tuple [45, 90]
      filename: images/puppy.bmp
      topleft: !!python/tuple [0, 45]
    - bottomright: !!python/tuple [45, 135]
      filename: images/puppy.bmp
      topleft: !!python/tuple [0, 90]
    - bottomright: !!python/tuple [45, 180]
      filename: images/puppy.bmp
      topleft: !!python/tuple [0, 135]
    name: puppyspr
    objtype: Sprite
startscreen: screen1
title: Catch the Puppy - GameBaker Demo
workstates:
  WS1: !!python/object:game.WorkState
    actions: {1: '

        self.x=400

        self.y=300

        self.vx = int(random.random() * 3)

        self.vy = int(random.random() * 3)

        self.resize(45,45)

        ', 3: '

        self.move_velocity()

        ', 5: '

        game.score = game.score + 1

        ', 9: '

        self.x=400

        self.y=300

        sign1 = random.random() - 0.5

        sign2 = random.random() - 0.5

        sign1 = sign1/abs(sign1)

        sign2 = sign2/abs(sign2)

        self.vx = sign1 * int(2 + random.random() * 3)

        self.vy = sign2 * int(2 + random.random() * 3)


        '}
    inherits: null
    objtype: Workstate
  WSScore: !!python/object:game.WorkState
    actions: {1: "\\nself.x = 0 \\nself.y = 0\\nself.color = (255,255,255)\\nself.resize((60,20))\\n\\
        self.clear()\\n", 3: '


        self.clear()

        self.draw_text(game.score,20,(255,0,0))

        '}
    inherits: null
    objtype: Workstate

"""
if __name__ == "__main__":
  import gbfileio,sys,runtime
  game = gbfileio.loadgame(sys.argv[0])
  runtime.run_game(game)
